package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BookshelfDetailsMapper;
import com.ruoyi.system.domain.BookshelfDetails;
import com.ruoyi.system.service.IBookshelfDetailsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 书架详情Service业务层处理
 * 
 * @author 许雅萍
 * @date 2024-11-19
 */
@Service
public class BookshelfDetailsServiceImpl extends ServiceImpl<BookshelfDetailsMapper,BookshelfDetails> implements IBookshelfDetailsService

{
    @Autowired
    private BookshelfDetailsMapper bookshelfDetailsMapper;

    /**
     * 查询书架详情
     * 
     * @param id 书架详情主键
     * @return 书架详情
     */
    @Override
    public BookshelfDetails selectBookshelfDetailsById(Long id)
    {
        return bookshelfDetailsMapper.selectBookshelfDetailsById(id);
    }

    /**
     * 查询书架详情列表
     * 
     * @param bookshelfDetails 书架详情
     * @return 书架详情
     */
    @Override
    public List<BookshelfDetails> selectBookshelfDetailsList(BookshelfDetails bookshelfDetails)
    {
        return bookshelfDetailsMapper.selectBookshelfDetailsList(bookshelfDetails);
    }

    /**
     * 新增书架详情
     * 
     * @param bookshelfDetails 书架详情
     * @return 结果
     */
    @Override
    public int insertBookshelfDetails(BookshelfDetails bookshelfDetails)
    {
        bookshelfDetails.setCreateTime(DateUtils.getNowDate());
        return bookshelfDetailsMapper.insertBookshelfDetails(bookshelfDetails);
    }

    /**
     * 修改书架详情
     * 
     * @param bookshelfDetails 书架详情
     * @return 结果
     */
    @Override
    public int updateBookshelfDetails(BookshelfDetails bookshelfDetails)
    {
        bookshelfDetails.setUpdateTime(DateUtils.getNowDate());
        return bookshelfDetailsMapper.updateBookshelfDetails(bookshelfDetails);
    }

    /**
     * 批量删除书架详情
     * 
     * @param ids 需要删除的书架详情主键
     * @return 结果
     */
    @Override
    public int deleteBookshelfDetailsByIds(String ids)
    {
        return bookshelfDetailsMapper.deleteBookshelfDetailsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除书架详情信息
     * 
     * @param id 书架详情主键
     * @return 结果
     */
    @Override
    public int deleteBookshelfDetailsById(Long id)
    {
        return bookshelfDetailsMapper.deleteBookshelfDetailsById(id);
    }
}
